package com.github.binarylei.hadoop.rpc;

import java.net.InetSocketAddress;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

public class RPCClient {

    private static String host = "master";
    private static int port = 10001;

	public static void main(String[] args) throws Exception {
		System.setProperty("hadoop.home.dir", "D:/Program_Files/apache/hadoop-common-bin/");
        Configuration conf = new Configuration();
        conf.set("fs.defaultFS", "hdfs://master:9000/");

		LoginServiceInterface proxy = RPC.getProxy(
		        LoginServiceInterface.class,
                1L,
                new InetSocketAddress(host, port),
                conf);
		
		String result = proxy.login("hadoop-test", "test");
		
		System.out.println(result);

	}
}
